/**
 * Created by CHENRI4 on 10/18/2016.
 */
Ext.define('sso.admin.user.store.UserStore',{
    extend:'Ext.data.Store',
    requires:[
        'sso.admin.user.model.UserModel',
    ],
    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            pageSize: 40,
            model: 'sso.admin.user.model.UserModel',
            proxy: {
                type: 'rest',
                url: 'users',
                reader: {
                    type: 'json',
                    root: 'content',
                    totalProperty : 'totalElements'
                },
                writer: {
                    type: 'json'
                },
                extraParams:{
                    sort:Ext.JSON.encode({
                        direction:'DESC',
                        property:'createTime'
                    })
                }
            },
            sorters: [{
                property: 'createTime',
                direction: 'DESC'
            }]
        }, cfg)]);
    }
})